import QtQuick 2.12

Rectangle {
    id: circle
    width: 100
    height: 100
    radius:50

    Canvas {
        id: mycanvas
        anchors.fill: parent
        onPaint: {
            let ctx = getContext("2d");
            //fill是填充绘图
            ctx.fillStyle = "#295ac2";
            ctx.arc(width / 2, height / 2, circle.radius, 0, Math.PI * 2);
            ctx.fill();

            //strokesh是绘制路径
            ctx.beginPath();
            ctx.lineWidth = 2;
            ctx.arc(width / 2, height / 2, circle.radius * 0.85, 0, Math.PI * 2);
            ctx.strokeStyle = "#ffffff";
            ctx.stroke();
        }
    }

    Image {
        anchors.centerIn: parent
        width: parent.width
        height: parent.height
        scale: 0.5
        antialiasing: true
        source: "qrc:/ui/bluetooth.svg"
    }

}
